<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>登录</title>
<script type="text/javascript" src="../js/jquery/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(function(){
	$("#login_in").click(function(){
		//alert("login_in");
		var account=$("#account").val();
		var password=$("#password").val();
		if(password==null||password==""){
			alert("密码不能为空！");
			return;
		}else if(account==null||account==""){
			alert("帐号不能为空！");
			return;
		}
		loginForm();
	})
});
function loginForm(){
	//alert("进入loginForm");
	$.post(
		"loginCheck",
		{
		account:$("#account").val(),
		password:$("#password").val()
			},
		function(rm){
			alert(rm.status+"***"+rm.message);
			if(rm.status==0){
				alert("帐号和密码错误，请重试！");
				return;
			}else if(rm.status==1){
				alert("登录成功！");
				location.href="localhost:8080/login/index";
			}
		},"json");
}
</script>
</head>
<body>
	<div>登录</div>
	<div id="loginForm" >
		<table>
			<tr>
				<td>帐号：</td>
				<td>
				<input type="text" id="account" name="account" value="${sysUser.account }"/>
				</td>
			</tr>
			<tr>
				<td>密码：</td>
				<td><input type="text" id="password" name="password" value="${sysUser.password }"/></td>
			</tr>
			<tr><td><input id="login_in" type="submit" value="提交"/></td></tr>
		</table>
	</div>
</body>
</html>